package com.changanw.dd.datasource;

/**
 * 用例存放当前线程所使用的数据源名称
 */
public class DynamicDataSourceContextHolder {
    private static ThreadLocal<String> DS_NAME = new ThreadLocal<>();

    public static void setDatasourceType(String dsType){
        DS_NAME.set(dsType);
    }

    public static String getDataSource(){
        return DS_NAME.get();
    }

    public static void clearDataSource(){
        DS_NAME.remove();
    }

}
